#include "kdcvideo.h"

#include <kdclib.h>

KDCVideo::KDCVideo( KDCVideoMetaData *aMetaData ) : pMetaData( aMetaData ), pBitrate( 0 ), pWidth( 0 ), pHeight( 0 )
{

}

KDCVideo::~KDCVideo()
{
	deletePtr( pMetaData );
}

void KDCVideo::copySettings( const KDCVideo& aVideo )
{
	pMode = aVideo.mode();
	pBitrate = aVideo.bitrate();
	pWidth = aVideo.width();
	pHeight = aVideo.height();
	pCodec = aVideo.codec();
	pAspectRatio = aVideo.aspectRatio();
}

KDCVideoMetaData* KDCVideo::metaData() const
{
	return pMetaData;
}

void KDCVideo::setBitrate( int aBitrate )
{
	pBitrate = aBitrate;
}

void KDCVideo::setAspectRatio( KDC::AspectRatio aAspectRatio )
{
	pAspectRatio = aAspectRatio;
}

void KDCVideo::setResolution( int aWidth, int aHeight )
{
	pWidth = aWidth;
	pHeight = aHeight;
}

int KDCVideo::bitrate() const
{
	return pBitrate;
}

int KDCVideo::width() const
{
	return pWidth;
}

int KDCVideo::height() const
{
	return pHeight;
}

KDC::AspectRatio KDCVideo::aspectRatio() const
{
	return pAspectRatio;
}

KDC::StreamMode KDCVideo::mode() const
{
	return pMode;
}

void KDCVideo::setMode( KDC::StreamMode aMode )
{
	pMode = aMode;
}

quint64 KDCVideo::size() const
{
	return qRound( 0.000125*pMetaData->length()*pBitrate );
}

bool KDCVideo::operator!=( const KDCVideo& aVideo )
{
	return false;
}

void KDCVideo::setCodec( KDC::VideoCodec aCodec )
{
	pCodec = aCodec;
}

KDC::VideoCodec KDCVideo::codec() const
{
	return pCodec;
}

